/*
 * Teknei 2014 - All rights reserved
 */
package com.teknei.acabus.core.entities;

import java.io.Serializable;
import javax.persistence.*;
import java.util.List;


/**
 * The persistent class for the "TABLE_A" database table.
 *  @author Jorge Amaro
 *  @version 1.0
 *  @since 1.0
 */
@Entity
@Table(name="\"SITM_TABLE_A\"")
@NamedQuery(name="TableA.findAll", query="SELECT t FROM TableA t")
public class TableA implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@SequenceGenerator(name="TABLE_A_IDFIELD_GENERATOR", sequenceName="\"TABLE_A_id_field_seq\"", allocationSize=1)
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="TABLE_A_IDFIELD_GENERATOR")
	@Column(name="id_field")
	private Integer idField;

	private String description;

	private String value;

	//bi-directional many-to-one association to TableC
	@OneToMany(mappedBy="tableA")
	private List<TableC> tableCs;

	/**
	 * 
	 */
	public TableA() {
	}

	/**
	 * @return
	 */
	public Integer getIdField() {
		return this.idField;
	}

	/**
	 * @param idField
	 */
	public void setIdField(Integer idField) {
		this.idField = idField;
	}

	/**
	 * @return
	 */
	public String getDescription() {
		return this.description;
	}

	/**
	 * @param description
	 */
	public void setDescription(String description) {
		this.description = description;
	}

	/**
	 * @return
	 */
	public String getValue() {
		return this.value;
	}

	/**
	 * @param value
	 */
	public void setValue(String value) {
		this.value = value;
	}

	/**
	 * @return
	 */
	public List<TableC> getTableCs() {
		return this.tableCs;
	}

	/**
	 * @param tableCs
	 */
	public void setTableCs(List<TableC> tableCs) {
		this.tableCs = tableCs;
	}

	/**
	 * @param tableC
	 * @return
	 */
	public TableC addTableC(TableC tableC) {
		getTableCs().add(tableC);
		tableC.setTableA(this);

		return tableC;
	}

	/**
	 * @param tableC
	 * @return
	 */
	public TableC removeTableC(TableC tableC) {
		getTableCs().remove(tableC);
		tableC.setTableA(null);

		return tableC;
	}

}